<?php $arrType = LoadConfig::$arrayTypeGame;  ?>  
<div class="left">
    <?php $this->widget("AdminLodeGame")?>
</div>
<form action="" method="get" name="thongke-form" id= "thongke-form">
<div class="right-main">
    <div class="righ-cont">
        <div class="right">
            <div class="title_style"> <span><b>Bảng thống kê LoDo Game</b></span></div>
            <p>Chọn tỉnh, ngày hoặc loại game để tìm kiếm</p>
            <div class="tool clearfix">
                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tbody>
                        <tr>
                            <td width="110" class="text-right"><label>Tỉnh đặt cược</label></td>
                            <td width="150"><select class="w90" name="pid"><option value ="0">Tất cả</option>
                            <?php for($i = 0; $i < count($province); $i++){?>
                            <option value="<?=$province[$i]['id']?>" <?=isset($_GET['pid']) && $_GET['pid'] == $province[$i]['id']?"selected='selected'":""?>><?=$province[$i]['name']?></option>
                            <?php }?>
                            </select></td>
                            <td width="60" class="text-right"><label>Từ ngày</label></td>
                            <td width="213"><span class="input1"><?php        
                                            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                                            'id'=>'begin',
                                            'name'=>'begin',
                                            'value'=>isset($_GET['begin'])?$_GET['begin']:date('d-m-Y',time()-2592000),
                                            'options'=>array(
                                            'showAnim'=>'fold',
                                            'dateFormat'=>'dd-mm-yy',
                                            ),
                                            'htmlOptions'=>array(
                                            'readonly'=>'readonly',
                                            ),
                                            ));

                                    ?></span></td>
                        </tr>
                        <tr>
                            <td width="80" class="text-right"><label>Loại Game</label></td>
                            <td width="100">
                            <select class="w90" name="type">
                                <option value ="0">Tất cả</option>
                            <?php foreach($arrType as $key=>$value):?>   
                                <option value="<?=$key?>" <?=isset($_GET['type']) && $_GET['type'] == $key ?"selected='selected'":""?>><?=$value?></option>
                            <?php endforeach;?>
                            </select>
                            </td>
                            
                            <td width="60" class="text-right"><label>Đến ngày</label></td>   
                            <td><span class="input1"> <?php        
                                            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                                            'id'=>'end',
                                            'name'=>'end',
                                            'value'=>isset($_GET['end'])?$_GET['end']:date('d-m-Y',time()), 
                                            'options'=>array(
                                            'showAnim'=>'fold',
                                            'dateFormat'=>'dd-mm-yy',
                                            ),
                                            'htmlOptions'=>array(
                                            'readonly'=>'readonly',
                                            ),
                                            ));

                                    ?></span>
                            </td>
                            <td><input type="submit" value="Tìm kiếm"></td>
                        </tr>
                    </tbody>
                </table>
                </div>
            
            <div class="table clearfix">
                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tbody>
                        <tr class="bg_gray">
                            <td width="5%"><b>STT</b></td>
                            <td width="10%"><strong>Ngày quay</strong></td>
                            <td width="8%"><strong>ID Ticket </strong></td>
                            <td width="10%"><strong>Thành viên</strong></td>
                            <td width="14%"><strong>Bộ số</strong></td>
                            <td width="9%"><b>Loại</b></td>
                            <td width="8%"><b>Tỉnh</b></td>
                            <td width="5%"><b>Xu</b></td>
                            <td width="11%"><b>Thanh Toán</b></td>
                        </tr>
                <?php for($i=0;$i<count($ticket);$i++){?>                       
                        <tr>
                            <td><?=$numPage + $i + 1?></td>
                            <td><?=$ticket[$i]['ngay_quay_thuong']?></td>
                            <td><?=$ticket[$i]['id']?></td>
                            <td><?=$ticket[$i]['username']?></td>
                            <td><?php echo rtrim($str_boso[$i],", ");?></td> 
                            <td><?php echo $arrType[$ticket[$i]['kieu_danh']]?> </td>                          
                            <td>XS <?=$ticket[$i]['province_name']?></td>
                            <td><?=$ticket[$i]['total_xu']?></td>
                            <td><?=$ticket[$i]['tien_thuong']?></td>
                        </tr>                   
                <?php }?>  
                    </tbody>
                </table>
                
            </div>
            <div class="fillters clearfix">
            <ul class="paging fr">
                <li><span class="nomal"><b><?=isset($page)?$page:"";?></b></span></a></li>
            </ul>
            </div>
        </div>
    </div>
</div>
</form>